[cpp-qt-client]Fix variable redeclarations in the api-body.mustache#22982
[cpp-qt-client]Fix variable redeclarations in the api-body.mustache#22982martonmiklos wants to merge 3 commits intoOpenAPITools:masterfrom
Conversation
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache:752">
P2: Typo introduces non-existent `{{prefix}}HttpRequestWorker4` type in implicit flow pending-request check, which will not compile and breaks request counting.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache
Outdated
Show resolved
Hide resolved
a0ba95b to
edc984a
Compare
|
thanks for the PR cc @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @MartinDelille (2018/03) @muttleyxd (2019/08) @aminya (2025/05) |
|
please share a spec to reproduce the issue |
MartinDelille
left a comment
There was a problem hiding this comment.
I'm fine with fixing this issue but not very fan of scope1, scope2, ... naming. Couldn't it be prefix to be more descriptive ? authFlowScope ? implicitFlowScope ?
Indeed, I will also introduce an enum for the _OauthMethod values. |
Generating API from the following schema results uncompilable code: |
There was a problem hiding this comment.
1 issue found across 22 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache:790">
P2: OAuth password flow assigns misspelled enum `ResourceOwnserPasswordFlow`, which doesn’t exist in the enum definition (`ResourceOwnerPasswordFlow`). This will break compilation or token retry routing for password flow.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache
Outdated
Show resolved
Hide resolved
ce8cbb4 to
dd4166d
Compare
MartinDelille
left a comment
There was a problem hiding this comment.
Like for scope1/scope2/..., I would avoid token1/token2/... by using the same naming convention (ie: tokenImplicitFlow ?).
…ames instead of numeric indexes
Ah, how did I missed them. Fixed now :) |
The generated code failed to compile if and endpoint had oauth2 enabled.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Fixes C++ Qt client OAuth2 code generation by removing scope/token redeclarations, using flow-suffixed variable names, and adopting a typed OauthMethod enum. Generated clients now compile and use clearer, safer auth flow handling.
Written for commit fef1373. Summary will update on new commits.